import axios from 'axios';
import router from 'umi/router';
import {message} from 'antd';

function addSubject(payload) {
	return axios.post('/api/subject/add',payload)
}
export default {
	namespace: 'add',
	state: {
		
	},
	effects: {
		* addSubject({payload,callback}, {
			call,
			put
		}) {
			console.log(payload)
			const {error,data} = yield call(addSubject,payload)
			callback()
		}
	},
	reducers: {
		initData(state,action){
			const {code,pic} = action.payload;
			return {...state,code,pic};
		}
	}
}